var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;
var _menu = _decorator.menu;
var _def_UIRotate = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.rotate = 5;
    t.time = .5;
    t.delayTime = 0;
    t.isCircle = false;
    t.isAuto = false;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onLoad = function () {
    this.isAuto || this.startRotate();
  };
  _creator.prototype.startRotate = function () {
    this.node.stopAllActions();
    this.node.angle = 0;
    !this.isCircle && this.node.runAction(cc.repeatForever(cc.sequence(cc.rotateBy(this.time, this.rotate), cc.rotateBy(this.time, -this.rotate), cc.rotateBy(this.time, -this.rotate), cc.rotateBy(this.time, this.rotate), cc.rotateBy(this.time, this.rotate), cc.rotateBy(this.time, -this.rotate), cc.rotateBy(this.time, -this.rotate), cc.rotateBy(this.time, this.rotate), cc.rotateBy(this.time, 0), cc.delayTime(this.delayTime))));
  };
  _creator.prototype.stopRotate = function () {
    !this.isCircle && this.node.stopAllActions();
    this.node.angle = 0;
  };
  _creator.prototype.update = function () {
    this.isCircle && (this.node.angle += this.rotate);
  };
  __decorate([_property({
    type: cc.Float
  })], _creator.prototype, "rotate", undefined);
  __decorate([_property({
    type: cc.Float
  })], _creator.prototype, "time", undefined);
  __decorate([_property({
    type: cc.Float
  })], _creator.prototype, "delayTime", undefined);
  __decorate([_property({
    tooltip: "是否一直转圈"
  })], _creator.prototype, "isCircle", undefined);
  __decorate([_property()], _creator.prototype, "isAuto", undefined);
  return __decorate([_ccclass, _menu("UI组件/UIRotate")], _creator);
}(cc.Component);
exports.default = _def_UIRotate;